# Maintainer:
pkgname=py3-pysequoia
pkgver=0.1.20
pkgrel=3
pkgdesc="Python bindings for the Sequoia PGP library"
url="https://codeberg.org/wiktor/pysequoia"
arch="all"
license="Apache-2.0"
makedepends="
	bzip2-dev
	cargo
	clang-libclang
	gmp-dev
	nettle-dev
	openssl-dev
	pcsc-lite-dev
	py3-gpep517
	py3-maturin
	py3-wheel
	"
checkdepends="
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="
	$pkgname-$pkgver.tar.gz::https://codeberg.org/wiktor/pysequoia/archive/v$pkgver.tar.gz
	cargo-update.patch
	"
builddir="$srcdir/pysequoia"
options="net" # cargo

prepare() {
	default_prepare

	cargo fetch --locked
}

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--config-json '{"build-args": "--frozen"}' \
		--output-fd 3 3>&1 >&2
}

check() {
	cargo test
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
1db48aa093420cc9733b122a96b813923e4e7ef040ddc8d79df1a1d0a2c6d26ffd33e9c56c4873df17720e374a377a4f294c0e8d0a134625b8daefc3bd74a9e2  py3-pysequoia-0.1.20.tar.gz
fcfb390d199a20c28dfa2124683a6e77386fbe8d7f3ac82d440b473d55a50f841ea364e2741f84c98b06dc510fa95ce74965399efc22121e53b48ee422991f59  cargo-update.patch
"
